home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 December / Australian PC User - December 2003 (CD2).iso / software / apps / files / dwmx2k4.exe / Disk1 / data1.cab / Configuration_En / Objects / Text / Comment.js < prev    next >
Encoding:
JavaScript  |  2003-09-05  |  904 b   |  31 lines

  1. // Copyright 2001, 2002, 2003 Macromedia, Inc. All rights reserved.
  2.  
  3. //---------------   GLOBAL VARIABLES   ---------------
  4.  
  5. var helpDoc = MM.HELP_objComment;
  6.  
  7. //---------------     API FUNCTIONS    ---------------
  8.  
  9. function isDOMRequired() { 
  10.     // Return false, indicating that this object is available in code view.
  11.     return false;
  12. }
  13.  
  14. function objectTag() {
  15.   var retVal = "";
  16.     var dom = dw.getDocumentDOM();
  17.   
  18.   if (dom.getView() == 'design' || (dom.getView() == 'split' && dw.getFocus(true) != 'textView')){
  19.        var cmdFile = dw.getConfigurationPath() + "/Commands/Comment_DesignView.htm";
  20.        var cmdDOM = dw.getDocumentDOM(cmdFile);
  21.    
  22.        dw.runCommand("Comment_DesignView.htm");
  23.        retVal = (cmdDOM.parentWindow.getCommentStr());
  24.   }else{
  25.     // Manually wrap comment markers around selection.
  26.       dom.source.wrapSelection('<!-- ',' -->');
  27.   }
  28.   
  29.   return retVal;
  30. }
  31.